#pragma once
#include "Common.h"
class CentralCache
{
private:
	CentralCache() {}
	CentralCache(const CentralCache&) = delete;
	static CentralCache s_inst;
private:
	SpanList spanLists[K_FREELISTS];
public:
	static CentralCache* GetInstance()
	{
		return &s_inst;
	}
	Span* GetOneSpan(SpanList& spanList, size_t bytes);
	size_t FetchRangeObj(void*& start, void*& end, size_t n, size_t bytes);
	void ReleaseListToSpans(void* start, size_t bytes);
};